﻿using CrawlerFramework.ConfigEntity;
using CrawlerFramework.CrawlerEngine;
using CrawlerFramework.Models;
using CrawlerFramework.PageProcessor;
using RakutenProxy.ConfigEntity;
using RakutenProxy.Model;
using RakutenProxy.Model.Rakuten;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RakutenProxy
{
    class Program
    {
        static void Main(string[] args)
        {
            var db = new RakutenDbContext();
            var created = db.Database.CreateIfNotExists();
            db.Dispose();

            if (created)
                return;

            var logService = new LogService();
            var pageProcessorBuilder = BasePageProcessorBuilder.Instance;
            var crawlerEngine = new BaseCrawlerEngine(pageProcessorBuilder, logService);
            crawlerEngine.ExecuteScheduledJob(Guid.Parse("216DF6E1-BC37-493C-9857-4E5037309B69"));
        }
    }
}
